home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_08
/
v7n8013a.txt
< prev
next >
Wrap
Text File
|
1989-10-01
|
764b
|
39 lines
*****Listing 3*****
#include <stdio.h>
void trace1(const char *filename, int line)
{
static unsigned int counter = 0;
++counter;
fprintf(stderr, "T1 %3u: file: %s, line: %d\n",
counter, filename, line)
{
static unsigned int counter = 0;
++counter;
fprintf(stderr, "T2 %3u: file: %s, line: %d\n\n",
counter, filename, line);
}
The output produced from this version is:
T1> 1: file: t1l.c, line: 11
inside f
T2> 1: file: t1.c, line: 11
T1> 2: file: t1g.c, line: 7
inside f
T2> 2: file: t1g.c, line: 7
T1> 3: file: t1.c, line: 13
inside f
T2> 3: file: t1.c, line: 13
where T1 and T2 indicate the output from trace1 and trace2, respectively.
*******************